package com.zero.sample.demon;

import java.util.List;

import com.zero.sample.entity.Test;
import com.zero.sample.service.Imyservices;

public class MyWebservices {
	private Imyservices myServices;
	
	
	public Test[] findAll(){
		Test[] arr = null;  
		List<Test> list = myServices.findAll();
		arr = new Test[list.size()];  
        for (int i = 0; i < list.size(); i++) {  
            arr[i] = list.get(i);  
        } 
        return arr;
	}
	
	
	public List<Test> findAllList(){
		List<Test> list = myServices.findAll();
        return list;
	}
	
	public Test findById(Long oid){
		return myServices.findById(oid);
	}
	
	
	public void setMyServices(Imyservices myServices) {
		this.myServices = myServices;
	}
	
	public boolean setList(Test[] test){
		if(test !=null){
			for (Test t : test) {
				myServices.saveTest(t);
			}
		}
		return true;
	}
	
	public Test setList1(Test test){
		if(test !=null){
				myServices.saveTest(test);
		}
		return test;
	}
	
	public void testStr(String str){
		System.out.println("testStr:"+str);
	}
	public String testStr2(String str){
		System.out.println("testStr2:"+str);
		return str;
	}
	
	public String testStr3(){
		System.out.println("--testStr3--");
		return "testStr3";
	}
	
	
}
